<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>v-model 结合单选按钮使用</title>
</head>
<body>
<div id="app">
    <form action="http://localhost">
        <div>
            潘家乐：
            <input type="radio" name="gender" id="man" value="男"  v-model="gender" required><label for="man">男</label>
            <input type="radio" name="gender" id="woman" value="女" v-model="gender"><label for="man">女</label>
        </div>

        <h2>您选中的性别：{{ gender }}</h2>
        <input type="submit" value="提交">
    </form>
</div>
<script type="module">
    import {createApp, ref} from "../../../../../js/vue.esm-browser.js";

    const app = createApp({
        setup() {
            let gender = ref(null)


            return {
                gender,
            }
        }
    })

    app.mount("#app")
</script>


</body>
</html>